#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  timeit.py
#       Author @  Huoty
#  Create date @  2015-08-12 10:37:10
#  Description @  
# *************************************************************

import time
 
def timeit(func):
    def wrapper():
        start = time.clock()
        func()
        end =time.clock()
        print 'used:', end - start
    return wrapper

@timeit
def foo():
    print 'in foo()'

# Script starts from here

foo()
